#include "stdafx.h"

#include "GSE_CDataSet.h"
namespace GSE
{
	CRow::CRow(CFieldMap * lpFields):mFieldMap(lpFields)
	{

	}

	uint CRow::Size() const
	{
		return mDatas.size();
	}

	void CRow::Push( const char * strVal,uint uLen )
	{
		mDatas.push_back(string(strVal,uLen));
	}

	const char * CRow::operator[]( int uIndex ) const
	{
		if ( (uint) uIndex >= Size() )
		{
			throw std::range_error("Index out of range");
		}
		return mDatas[uIndex].c_str();
	}
	const char * CRow::operator [] (const char * strFieldName) const
	{
		return mDatas[(*mFieldMap)[strFieldName]].c_str();
	}
}